<div class="cat_page">
    <div class="def_div f_left">
        <?php
        if (isset($wishlist_option) and ($wishlist_option)) {
            if ($wishlist_option == "new") {
                //pr($WishlistProduct);
                //exit;
                ?>
                <!--   Form to Create New WishList-->  
                <div class="item_list_show">
                    <h2>Create A Wishlist </h2>
                    <div class="common_border1"></div>
        <?php echo $form->create('Product', array('action' => "", 'id' => 'search')) ?>
                    <?php
                    if (isset($WishlistProduct['product_id']) and ($WishlistProduct['product_id'])) {
                        echo $this->Form->input('New.WishlistProduct.product_id', array('type' => 'hidden', 'value' => $WishlistProduct['product_id']));
                    }
                    ?>
                    <?php
                    if (isset($WishlistProduct['product_id']) and ($WishlistProduct['product_id'])) {
                        echo $this->Form->input('New.WishlistProduct.wisn', array('required' => true, 'type' => 'hidden', 'value' => $WishlistProduct['wisn']));
                    }
                    if (isset($editable_wish_list['Wishlist']) and ($editable_wish_list['Wishlist'])) {
                        echo $this->Form->input('New.Wishlist.id', array('type' => 'hidden',
                            'required' => true, 'value' => $editable_wish_list['Wishlist']['id']));
                    }
                    ?>
                    <div class="def_div f_left">
                        <div class="def_div f_left">
                            <div class="acc_form_1">Name Your Wishlist :</div>
                            <div class="acc_form_2">
                    <?php
                    if (isset($editable_wish_list['Wishlist']['name']) and ($editable_wish_list['Wishlist']['name'])) {
                        $name = $editable_wish_list['Wishlist']['name'];
                    } else {
                        $name = "";
                    }
                    ?>
                                <?php echo $this->Form->input('New.Wishlist.name', array('required' => true,
                                    'type' => 'text', 'value' => $name, 'class' => 'field', 'label' => false)); ?>
                            </div>
                        </div>
                        <div class="def_div f_left">
                            <div class="acc_form_1">Set who Can see this list : </div>
                            <div class="acc_form_2">
                                <div class="def_div f_left">
                                <?php
                                $access_1 = "";
                                $access_2 = "";
                                if (isset($editable_wish_list['Wishlist']['access']) and ($editable_wish_list['Wishlist']['access'] == "public")) {
                                    $access_1 = "checked";
                                } else {
                                    $access_2 = "";
                                }
                                ?>
                                    <label>
                                        <input type="radio" name="data[New][Wishlist][access]"  checked="<?php echo $access_1; ?>" value="public">
                                        Public</label>
                                    <span class="gray_comment">Anyone can search for and see this list.</span> </div>
                                <div class="pad_10"></div>
                                <div class="def_div f_left">
                                    <label>
                                        <input type="radio" name="data[New][Wishlist][access]" checked="<?php echo $access_2; ?>"  value="private">
                                        Private</label>
                                    <span class="gray_comment">Only you can search this list</span> </div>
                            </div>
                        </div>
                        <div class="def_div f_left">
                            <div class="acc_form_1"><span class="font_16 blue_text">About this list</span></div>
                            <div class="acc_form_2">&nbsp;</div>
                        </div>

                        <div class="def_div f_left">
                            <div class="acc_form_1">E-mail :</div>
                            <div class="acc_form_2">
        <?php
        if (isset($editable_wish_list['Wishlist']['email']) and ($editable_wish_list['Wishlist']['email'])) {
            $email = $editable_wish_list['Wishlist']['email'];
        } else {
            $email = "";
        }
        ?>
        <?php //echo $this->Form->input('New.Wishlist.email',  array('type' => 'text','required'=>true,'value'=>$email,'class'=>'field',
        //'label' =>false));  ?>

                                <input type="email" id="NewWishlistEmail" class="field" value="" required="1" name="data[New][Wishlist][email]">

                            </div>
                        </div>
                        <div class="def_div f_left">
                            <div class="acc_form_1">Birthday : </div>
                            <div class="acc_form_2">
                                <?php
                                if (isset($editable_wish_list['Wishlist']['birthday']) and ($editable_wish_list['Wishlist']['birthday'])) {
                                    $birthday = $editable_wish_list['Wishlist']['birthday'];
                                    $birthday_exp = explode('-', $editable_wish_list['Wishlist']['birthday']);
                                    //pr($birthday_exp);

                                    $birthday_exp_m = $birthday_exp[1];
                                    $birthday_exp_d = $birthday_exp[2];
                                } else {
                                    $birthday_exp_m = "";
                                    $birthday_exp_d = "";
                                }
                                ?>

                                <select class="select_count1" name="data[New][Wishlist][month]">
                                <?php
                                $month_names = array("January", "February", "March",
                                    "April", "May", "June", "July", "August", "September", "October", "November", "December");
                                $count = count($month_names);
                                for ($i = 0; $i <= ($count - 1); $i++) {

                                    if (($i + 1) == $birthday_exp_m) {
                                        echo '<option value="' . ($i + 1) . '" selected="selected"> ' . $month_names[$i] . ' </option>';
                                    } else {
                                        echo '<option value="' . ($i + 1) . '"> ' . $month_names[$i] . ' </option>';
                                    }
                                }
                                ?>   
                                </select>
                                <select class="select_count2" name="data[New][Wishlist][day]">
                                <?php
                                $month_range = range(1, 31);
                                $countmonth_range = count($month_range);
                                for ($i = 0; $i <= ($countmonth_range - 1); $i++) {
                                    if (($i) == $birthday_exp_d) {
                                        echo '<option value="' . $month_range[$i] . '" selected="selected"> ' . $month_range[$i] . ' </option>';
                                    } else {
                                        echo '<option value="' . $month_range[$i] . '"> ' . $month_range[$i] . ' </option>';
                                    }
                                }
                                ?>	
                                </select>
                            </div>
                        </div>
                        <div class="def_div f_left">
                            <div class="acc_form_1">Unique Facts :</div>
                            <div class="acc_form_2">
                                    <?php
                                    if (isset($editable_wish_list['Wishlist']['unique_facts']) and ($editable_wish_list['Wishlist']['unique_facts'])) {
                                        $unique_facts = $editable_wish_list['Wishlist']['unique_facts'];
                                    } else {
                                        $unique_facts = "";
                                    }
                                    ?>
                                <textarea required="required" name="data[New][Wishlist][unique_facts]"><?php echo $unique_facts; ?></textarea>
                                <span class="gray_comment">Examples: "Hiking and sailing", "I attend the University of Idaho".</span> </div>
                        </div>
                        <div class="def_div f_left">
                                    <?php
                                    $address_id_rol_1 = "";
                                    $address_id_rol_2 = "";
                                    if (isset($editable_wish_list['Wishlist']['address_id']) and ($editable_wish_list['Wishlist']['address_id'])) {
                                        $address_id = $editable_wish_list['Wishlist']['address_id'];
                                        if (isset($address_id) and ($address_id = 0)) {
                                            $address_id_rol_1 = "checked";
                                        } else {
                                            $address_id_rol_2 = "checked";
                                        }
                                    } else {
                                        $address_id = "";
                                    }
                                    ?>

                            <div class="acc_form_1"><span class="font_16 blue_text">Ship-to address</span></div>
                            <div class="acc_form_2">&nbsp;</div>
                        </div>
                        <div class="def_div f_left">
                            <div class="acc_form_1">&nbsp;</div>
                            <div class="acc_form_2">
                                <div class="def_div f_left">
                                    <label>
                                        <input type="radio"  class="firstcheck" checked="<?php echo $address_id_rol_1; ?>"  value="0" name="data[New][Wishlist][address]">
                                        None
                                    </label>
                                </div>
                                <div class="pad_10"></div>
                                <div class="def_div f_left">
                                    <label>
                                        <input type="radio"  class="firstcheck" checked="<?php echo $address_id_rol_2; ?>" value="1" name="data[New][Wishlist][address]">
                                        Use an address from your address book
                                    </label>

                            <?php
                            echo $this->Form->input('New.Wishlist.address_id', array('type' => 'select', 'options' => $huk_address,
                                'class' => 'ProductAttribute', 'default' => $address_id, 'empty' => false, 'label' => false)
                            );
                            ?>
                                </div>
                                <div class="pad_10"></div>
                                <div class="def_div f_left">
                                    <label>
                                        <input type="radio"  id="addaddressWishList" value="2" name="data[New][Wishlist][address]">
                                        Enter a new address
                                    </label>
                                </div>


                            </div>
                        </div>
                        <!--********new address field****************************-->
                        <div class="def_div f_left" id="wishlistaddaddress" style="display:none;">

                            <div class="def_div f_left">
                                <div class="acc_form_1">Full Name :</div>
                                <div class="acc_form_2">       
        <?php echo $this->Form->input('New.Address.name', array('type' => 'text', 'autocomplete' => 'off', 'required' => false, 'class' => 'fie1', 'label' => false)); ?> 
                                </div>
                            </div>

                            <div class="def_div f_left">
                                <div class="acc_form_1">Address Line 1 :</div>
                                <div class="acc_form_2">
        <?php echo $this->Form->input('New.Address.add1', array('type' => 'text', 'autocomplete' => 'off', 'required' => false, 'class' => 'fie1', 'label' => false)); ?> 
                                    <span class="gray_comment">Street address</span> </div>
                            </div>
                            <div class="def_div f_left">
                                <div class="acc_form_1">Address Line 2 :</div>
                                <div class="acc_form_2">
                                    <?php echo $this->Form->input('New.Address.add2', array('type' => 'text', 'autocomplete' => 'off', 'required' => false, 'class' => 'fie1', 'label' => false)); ?> 
                                    <span class="gray_comment">Suite, unit, building, floor, etc.</span> </div>
                            </div>
                            <div class="def_div f_left">
                                <div class="acc_form_1">City/Town :</div>
                                <div class="acc_form_2">
                                    <?php echo $this->Form->input('New.Address.city', array('type' => 'text', 'autocomplete' => 'off', 'required' => false, 'class' => 'fie1', 'label' => false)); ?> 
                                </div>
                            </div>
                            <div class="def_div f_left">
                                <div class="acc_form_1">Province/Region/State :</div>
                                <div class="acc_form_2">
        <?php echo $this->Form->input('New.Address.state', array('type' => 'text', 'autocomplete' => 'off', 'required' => false, 'class' => 'fie1', 'label' => false)); ?> 
                                </div>
                            </div>
                            <div class="def_div f_left">
                                <div class="acc_form_1">Postal Code/Zip Code :</div>
                                <div class="acc_form_2">
        <?php echo $this->Form->input('New.Address.zip', array('type' => 'text', 'autocomplete' => 'off', 'required' => false, 'class' => 'fie1', 'label' => false)); ?> 
                                </div>
                            </div>
                            <div class="def_div f_left">
                                <div class="acc_form_1">Country :</div>
                                <div class="acc_form_2">
                                    <?php echo $form->input('New.Address.country', array('options' => $list_countries, 'value' => '', 'class' => 'select_count dropbox', 'label' => false, 'empty' => false)); ?>
                                </div>
                            </div>


                        </div>
                        <!--********************************-->
                        <div class="pad_10"></div>
                        <!--<div class="def_div f_left">
                          <div class="acc_form_1">&nbsp;</div>
                          <div class="acc_form_2">
                                <label>
                                  <input type="checkbox" value="" name="">
                                  Don't spoil my surprises (<a class="blue_link" href="#">What's this?</a>) </label>
                          </div>
                        </div>-->
                        <!--<div class="def_div f_left">
                          <div class="acc_form_1">&nbsp;</div>
                          <div class="acc_form_2">
                                <label>
                                  <input type="checkbox" value="" name="">
                                  This Wish List is for an organization<br>
                                  <br>
                                  If this Wish List is for an organization, please create a profile that helps visitors to your list identify your organization. Your full shipping address will be displayed on the list, as well as your Web site URL. If you are a tax-exempt charity, please include your 501(c)(3) number in your Unique Facts. </label>
                          </div>
                        </div>-->
                        <div class="def_div f_left">
                            <div class="acc_form_1">&nbsp; </div>
                            <div class="acc_form_2">
                                <input type="submit" class="form_btn" value="Submit" name="">
                            </div>
                        </div>
                    </div>
        <?php echo $form->end(); ?>
                </div>
        <?php
    } elseif ($wishlist_option == "select") {
        ?>
                                    <?php echo $form->create('Product', array('action' => "", 'id' => 'search')) ?>
                                    <?php
                                    if (isset($WishlistProduct['product_id']) and ($WishlistProduct['product_id'])) {
                                        $WishlistProduct['product_id'] = $WishlistProduct['product_id'];
                                    } else {
                                        $WishlistProduct['product_id'] = "";
                                    }
                                    if (isset($WishlistProduct['wisn']) and ($WishlistProduct['wisn'])) {
                                        $WishlistProduct['wisn'] = $WishlistProduct['wisn'];
                                    } else {
                                        $WishlistProduct['wisn'] = "";
                                    }
                                    echo $this->Form->input('Existing.WishlistProduct.product_id', array('type' => 'hidden', 'value' => $WishlistProduct['product_id']));
                                    ?>
        <?php echo $this->Form->input('Existing.WishlistProduct.wisn', array('type' => 'hidden', 'value' => $WishlistProduct['wisn'])); ?>
                <!--   Form to choose Multiple WishList-->  
                <div class="item_list_show">
                    <h2>Add to Wishlist </h2>
                    <div class="common_border1"></div>
                    <div class="def_div f_left">
                        <div class="def_div f_left">
                            <div class="acc_form_1">Wishlist : </div>
                            <div class="acc_form_2">
        <?php
        if (isset($wishlist_list) and ($wishlist_list)) {
            foreach ($wishlist_list as $wishlist) {
                ?>
                                        <div class="def_div f_left">
                                            <label>
                                                <input type="radio" value="<?php echo $wishlist['Wishlist']['id']; ?>" name="data[Existing][WishlistProduct][wishlist_id]">
                <?php echo $wishlist['Wishlist']['name']; ?>
                                            </label>
                                        </div>
                                        <div class="pad_10"></div>
                            <?php
                        }
                    }
                    ?>
                            </div>
                        </div>
                        <div class="def_div f_left">
                            <div class="acc_form_1">&nbsp; </div>
                            <div class="acc_form_2">
                                <input type="submit" class="form_btn" value="Submit" name="">
                            </div>
                        </div>
                    </div>
                </div>
                <?php echo $form->end(); ?>
                <?php
            }
        }
        ?>
    </div>
</div>
